﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WebUserControlLoginAdmin : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        
    }
    protected void bntLogin_Click(object sender, EventArgs e)
    {
        DangNhapBLL DNL = new DangNhapBLL();
        int kt = DNL.CheckDangNhap(txtTaiKhoan.Text.Trim(), txtMatKhau.Text.Trim());
        if (kt == 1)
        {
            Session["Admin"] = true;
            Session["TenAdmin"] = txtTaiKhoan.Text;
            Response.Redirect("DefaultAdmin.aspx");
        }
        else
        {
            lblThongBao.Visible = true;
            lblThongBao.Text = "Thông tin không đúng !";
        }

    }
}